package com.yuncheng.spcyApi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yuncheng.spcyApi.constant.common.SpcyCommonConstant;
import com.yuncheng.spcyApi.entity.SpcyJcyTxypjpsq;
import com.yuncheng.spcyApi.mapper.SpcyJcyTxypjpsqMapper;
import com.yuncheng.spcyApi.service.ISpcyJcyTxypjpsqService;
import com.yuncheng.spcyApi.utils.GetCurrentUserUtils;
import org.springframework.stereotype.Service;

import com.yuncheng.common.base.service.impl.BaseServiceImpl;

import java.util.List;

/**
 * @Description: 检查员-退休延聘解聘申请
 * @Author: yuncheng
 * @Date: 2024-01-17
 * @Version: V1.0
 */
@Service
public class SpcyJcyTxypjpsqServiceImpl extends BaseServiceImpl<SpcyJcyTxypjpsqMapper, SpcyJcyTxypjpsq> implements ISpcyJcyTxypjpsqService {

    @Override
    public List<SpcyJcyTxypjpsq> selectYpsqList(String fshzt) {
        return list(new LambdaQueryWrapper<SpcyJcyTxypjpsq>()
                .eq(SpcyJcyTxypjpsq::getFuserid, GetCurrentUserUtils.getCurrentUserId())
                .eq(SpcyJcyTxypjpsq::getFsqlx, SpcyCommonConstant.TXYPJP_SQLX_YP)
                .eq(SpcyJcyTxypjpsq::getFshzt, fshzt));
    }

    @Override
    public List<SpcyJcyTxypjpsq> selectYpsqListInWsh(String userid) {
        return list(new LambdaQueryWrapper<SpcyJcyTxypjpsq>()
                .eq(SpcyJcyTxypjpsq::getFuserid, userid)
                .eq(SpcyJcyTxypjpsq::getFsqlx, SpcyCommonConstant.TXYPJP_SQLX_YP)
                .ne(SpcyJcyTxypjpsq::getFshzt, SpcyCommonConstant.TXYPJP_SQ_SHZT_YSH));
    }

    @Override
    public List<SpcyJcyTxypjpsq> selectYpsqListByTysq() {
        return list(new LambdaQueryWrapper<SpcyJcyTxypjpsq>()
                .eq(SpcyJcyTxypjpsq::getFuserid, GetCurrentUserUtils.getCurrentUserId())
                .eq(SpcyJcyTxypjpsq::getFsqlx, SpcyCommonConstant.TXYPJP_SQLX_YP)
                .eq(SpcyJcyTxypjpsq::getFsftysq, SpcyCommonConstant.TXYPJP_SQ_SFTYSQ_YES)
                .orderByDesc(SpcyJcyTxypjpsq::getFfqsj));
    }

    @Override
    public List<SpcyJcyTxypjpsq> selectJpsqList(String fshzt) {
        return list(new LambdaQueryWrapper<SpcyJcyTxypjpsq>()
                .eq(SpcyJcyTxypjpsq::getFuserid, GetCurrentUserUtils.getCurrentUserId())
                .eq(SpcyJcyTxypjpsq::getFsqlx, SpcyCommonConstant.TXYPJP_SQLX_JP)
                .eq(SpcyJcyTxypjpsq::getFshzt, fshzt));
    }

    @Override
    public List<SpcyJcyTxypjpsq> selectJpsqListInWsh(String userid) {
        return list(new LambdaQueryWrapper<SpcyJcyTxypjpsq>()
                .eq(SpcyJcyTxypjpsq::getFuserid, userid)
                .eq(SpcyJcyTxypjpsq::getFsqlx, SpcyCommonConstant.TXYPJP_SQLX_JP)
                .ne(SpcyJcyTxypjpsq::getFshzt, SpcyCommonConstant.TXYPJP_SQ_SHZT_YSH));
    }

    @Override
    public List<SpcyJcyTxypjpsq> selectJpsqListByTysq() {
        return list(new LambdaQueryWrapper<SpcyJcyTxypjpsq>()
                .eq(SpcyJcyTxypjpsq::getFuserid, GetCurrentUserUtils.getCurrentUserId())
                .eq(SpcyJcyTxypjpsq::getFsqlx, SpcyCommonConstant.TXYPJP_SQLX_JP)
                .eq(SpcyJcyTxypjpsq::getFsftysq, SpcyCommonConstant.TXYPJP_SQ_SFTYSQ_YES)
                .orderByDesc(SpcyJcyTxypjpsq::getFfqsj));
    }
}
